fix(devframe): keep whenexpr types external in dts bundling#100
Merged
Conversation
Bundling whenexpr's declaration file into the combined dts build made
rolldown's dts bundler choke on its mixed type/value named export list
(export { type WhenExpression, evaluateWhen, ... }) — it dropped the
type modifier off the re-exported WhenExpression alias and then failed
to resolve it as a value export, breaking devframe's build (and every
downstream CI job that depends on it).
whenexpr's runtime code still gets inlined via onlyBundle; only its
.d.ts is now left external via the new deps.dts.neverBundle override,
so tsdown resolves WhenExpression straight from the published
package's types instead of re-bundling them.
✅ Deploy Preview for devfra ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CI (and the release workflow) was red on
main:devframe's combined dts build failed withwhenexpris listed indeps.onlyBundleso its runtime code gets inlined intodist/. That same config also drove the dts build, so rolldown's dts bundler tried to inlinewhenexpr's declaration file too — and choked on its mixed type/value named-export list (export { type WhenExpression, evaluateWhen, ... }), dropping thetypemodifier off the re-exportedWhenExpressionalias and then failing to resolve it as a value export.Fix
Use tsdown's
deps.dts.neverBundleoverride (added in tsdown v0.22.1) to keepwhenexpr's types external while its runtime code is still inlined viaonlyBundle. The generated.d.mtsnow importsWhenExpressionstraight from the publishedwhenexprpackage instead of re-bundling it.Verified locally:
pnpm build,pnpm lint,pnpm typecheck, andpnpm test(665 tests) all pass.Created with the help of an agent.